Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

SUP-2881, Show placements on challenge cards only for "Contest Submis… #620

Merged

Conversation

vikasrohit
Copy link
Contributor

@parthshah @nlitwin @tladendo Please review the changes. @tladendo it would be great, as you have recently worked on design challenges issues, if you can take a look at changes, specifically for changing the style and use of _.min instead of _.max function.

-- Added filter for submission type being 'Contest Submission' for calculating highest placement for the design challenges
-- Fixed use of calculation of highest placement, it was using _.max while we should use _.min instead.
-- Fixed style in case we are not showing placement for past challenges

…sion" type submissions

-- Added filter for submission type being 'Contest Submission' for calculating highest placement for the design challenges
-- Fixed use of calculation of highest placement, it was using _.max while we should use _.min instead.
-- Fixed style in case we are not showing placement for past challenges
@@ -59,7 +59,9 @@
$scope.imageURL = $scope.challenge.userDetails.submissions[0].submissionImage && $scope.challenge.userDetails.submissions[0].submissionImage.full;
$scope.selectedImage = $scope.imageURL;

$scope.challenge.highestPlacement = _.max($scope.challenge.userDetails.submissions, 'placement').placement;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tladendo @parthshah @nlitwin Do you guys see use of _.min instead of _.max, inappropriate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is placement ordered 1 highest, 2 second, i.e. the higher the number, the lower rank you are? If so, then _.min seems appropriate. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it should be like that. We already have that for other tracks, but somehow design subtrack is still using _.max.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused , shouldn't we be using _.min? 1 being the best placement / rank.
@vikasrohit can we merge this and have this qa'd once we have answered the above question?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should and that is why I have changed it to _.min. However, I just want to make sure that I didn't miss anything which was trivial and I was not able to see that and further, why this is never caught when we are doing exactly opposite to what is required. :)

@vikasrohit
Copy link
Contributor Author

Merging PR to get it QA'ed.

vikasrohit pushed a commit that referenced this pull request Dec 22, 2015
…ment-for-content-submissions-only

SUP-2881, Show placements on challenge cards only for "Contest Submis…
@vikasrohit vikasrohit merged commit 129ca21 into dev Dec 22, 2015
@vikasrohit vikasrohit deleted the feature/sup-2881-show-placement-for-content-submissions-only branch December 30, 2015 06:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants